const express=require('express')
const albumC=express.Router()

const axios=require('axios')

//未审核图片分页
albumC.get('/albumc/queryByPage', (req, res) => {
    let { pageNow, pageSize } = req.query
    axios({
        method: 'get',
        url: '/Admin/Aduit/queryByPage',
        params: {
            pageNow:pageNow||1,
            pageSize: pageSize||6,
            state:1
        },
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token:(req.session.token?req.session.token:'')
        }
    }).then(data => {
        res.status(200).json({
            key: data.data
        })
    }).catch(err => {
        console.log(err);
        res.status(200).json({
            err: err
        })
    })
})

//审核
albumC.get('/albumc/update', (req, res) => {
    let { ids, result } = req.query
    console.log(result);
    console.log(ids);
    axios({
        method: 'put',
        url: '/Admin/Aduit/update',
        params: {
            Id:ids,
            result:result,
        },
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token:(req.session.token?req.session.token:'')
        }
    }).then(data => {
        res.status(200).json({
            key: data.data
        })
    }).catch(err => {
        console.log(err);
        res.status(200).json({
            err: err
        })
    })
})

module.exports=albumC